using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableOrderItem
	{
		public const string Table = "OrderItem";
		public const string OrderItemID = "OrderItemID";
		public const string OrdersID = "OrdersID";
		public const string VegetablesTypeID = "VegetablesTypeID";
		public const string VegetablesTypeName = "VegetablesTypeName";
		public const string VegetablesName = "VegetablesName";
		public const string OriginalPrice = "OriginalPrice";
		public const string SalesGuidePrice = "SalesGuidePrice";
		public const string Discount = "Discount";
		public const string Quantity = "Quantity";
		public const string NumberOfUnitsID = "NumberOfUnitsID";
		public const string NumberOfUnitsName = "NumberOfUnitsName";
		public const string SubTotal = "SubTotal";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
		public const string VegetablesID = "VegetablesID";
		public const string BusinessID = "BusinessID";
		public const string PurchasePrice = "PurchasePrice";
		public const string VegetablesNo = "VegetablesNo";
		public const string OrderItemNo = "OrderItemNo";
		public const string OrderItemStatusID = "OrderItemStatusID";
		public const string Weigth = "Weigth";
		public const string IsWeight = "IsWeight";
		public const string WeightCount = "WeightCount";
	}
	
	[Serializable]
	public class BaseOrderItem
		: IDbSessionEntity, IJsonClass
	{
		int m_OrderItemID;
		/// <summary>
        /// 订单项表ID
        /// </summary>
        public int OrderItemID
        {
            get { return m_OrderItemID; }
            set { m_OrderItemID = value; }
        }
		
		int? m_OrdersID;
		/// <summary>
        /// 订单表ID
        /// </summary>
        public int? OrdersID
        {
            get { return m_OrdersID; }
            set { m_OrdersID = value; }
        }
		
		int m_VegetablesTypeID;
		/// <summary>
        /// 蔬菜类型ID
        /// </summary>
        public int VegetablesTypeID
        {
            get { return m_VegetablesTypeID; }
            set { m_VegetablesTypeID = value; }
        }
		
		string m_VegetablesTypeName;
		/// <summary>
        /// 蔬菜类型名称
        /// </summary>
        public string VegetablesTypeName
        {
            get { return m_VegetablesTypeName; }
            set { m_VegetablesTypeName = value; }
        }
		
		string m_VegetablesName;
		/// <summary>
        /// 蔬菜名称
        /// </summary>
        public string VegetablesName
        {
            get { return m_VegetablesName; }
            set { m_VegetablesName = value; }
        }
		
		double m_OriginalPrice;
		/// <summary>
        /// 原价
        /// </summary>
        public double OriginalPrice
        {
            get { return m_OriginalPrice; }
            set { m_OriginalPrice = value; }
        }
		
		double m_SalesGuidePrice;
		/// <summary>
        /// 销售价
        /// </summary>
        public double SalesGuidePrice
        {
            get { return m_SalesGuidePrice; }
            set { m_SalesGuidePrice = value; }
        }
		
		double m_Discount;
		/// <summary>
        /// 折扣(暂时使用计算)
        /// </summary>
        public double Discount
        {
            get { return m_Discount; }
            set { m_Discount = value; }
        }
		
		double m_Quantity;
		/// <summary>
        /// 数量
        /// </summary>
        public double Quantity
        {
            get { return m_Quantity; }
            set { m_Quantity = value; }
        }
		
		int m_NumberOfUnitsID;
		/// <summary>
        /// 数量单位ID
        /// </summary>
        public int NumberOfUnitsID
        {
            get { return m_NumberOfUnitsID; }
            set { m_NumberOfUnitsID = value; }
        }
		
		string m_NumberOfUnitsName;
		/// <summary>
        /// 数量单位
        /// </summary>
        public string NumberOfUnitsName
        {
            get { return m_NumberOfUnitsName; }
            set { m_NumberOfUnitsName = value; }
        }
		
		double m_SubTotal;
		/// <summary>
        /// 合计
        /// </summary>
        public double SubTotal
        {
            get { return m_SubTotal; }
            set { m_SubTotal = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		int m_VegetablesID;
		/// <summary>
        /// 
        /// </summary>
        public int VegetablesID
        {
            get { return m_VegetablesID; }
            set { m_VegetablesID = value; }
        }
		
		int m_BusinessID;
		/// <summary>
        /// 
        /// </summary>
        public int BusinessID
        {
            get { return m_BusinessID; }
            set { m_BusinessID = value; }
        }
		
		double m_PurchasePrice;
		/// <summary>
        /// 
        /// </summary>
        public double PurchasePrice
        {
            get { return m_PurchasePrice; }
            set { m_PurchasePrice = value; }
        }
		
		string m_VegetablesNo;
		/// <summary>
        /// 
        /// </summary>
        public string VegetablesNo
        {
            get { return m_VegetablesNo; }
            set { m_VegetablesNo = value; }
        }
		
		string m_OrderItemNo;
		/// <summary>
        /// 
        /// </summary>
        public string OrderItemNo
        {
            get { return m_OrderItemNo; }
            set { m_OrderItemNo = value; }
        }
		
		int m_OrderItemStatusID;
		/// <summary>
        /// 
        /// </summary>
        public int OrderItemStatusID
        {
            get { return m_OrderItemStatusID; }
            set { m_OrderItemStatusID = value; }
        }
		
		double m_Weigth;
		/// <summary>
        /// 
        /// </summary>
        public double Weigth
        {
            get { return m_Weigth; }
            set { m_Weigth = value; }
        }
		
		bool m_IsWeight;
		/// <summary>
        /// 
        /// </summary>
        public bool IsWeight
        {
            get { return m_IsWeight; }
            set { m_IsWeight = value; }
        }
		
		int m_WeightCount;
		/// <summary>
        /// 
        /// </summary>
        public int WeightCount
        {
            get { return m_WeightCount; }
            set { m_WeightCount = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_OrderItemID = reader[TableOrderItem.OrderItemID];
            m_OrdersID = reader[TableOrderItem.OrdersID];
            m_VegetablesTypeID = reader[TableOrderItem.VegetablesTypeID];
            m_VegetablesTypeName = reader[TableOrderItem.VegetablesTypeName];
            m_VegetablesName = reader[TableOrderItem.VegetablesName];
            m_OriginalPrice = reader[TableOrderItem.OriginalPrice];
            m_SalesGuidePrice = reader[TableOrderItem.SalesGuidePrice];
            m_Discount = reader[TableOrderItem.Discount];
            m_Quantity = reader[TableOrderItem.Quantity];
            m_NumberOfUnitsID = reader[TableOrderItem.NumberOfUnitsID];
            m_NumberOfUnitsName = reader[TableOrderItem.NumberOfUnitsName];
            m_SubTotal = reader[TableOrderItem.SubTotal];
            m_Creater = reader[TableOrderItem.Creater];
            m_CreatedBy = reader[TableOrderItem.CreatedBy];
            m_Created = reader[TableOrderItem.Created];
            m_Modified = reader[TableOrderItem.Modified];
            m_ModifiedBy = reader[TableOrderItem.ModifiedBy];
            m_ModifiedByID = reader[TableOrderItem.ModifiedByID];
            m_VegetablesID = reader[TableOrderItem.VegetablesID];
            m_BusinessID = reader[TableOrderItem.BusinessID];
            m_PurchasePrice = reader[TableOrderItem.PurchasePrice];
            m_VegetablesNo = reader[TableOrderItem.VegetablesNo];
            m_OrderItemNo = reader[TableOrderItem.OrderItemNo];
            m_OrderItemStatusID = reader[TableOrderItem.OrderItemStatusID];
            m_Weigth = reader[TableOrderItem.Weigth];
            m_IsWeight = reader[TableOrderItem.IsWeight];
            m_WeightCount = reader[TableOrderItem.WeightCount];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableOrderItem.OrderItemID, PrimaryKeyType.Identity, OrderItemID);
			writer[TableOrderItem.OrdersID] = OrdersID;
			writer[TableOrderItem.VegetablesTypeID] = VegetablesTypeID;
			writer[TableOrderItem.VegetablesTypeName] = VegetablesTypeName;
			writer[TableOrderItem.VegetablesName] = VegetablesName;
			writer[TableOrderItem.OriginalPrice] = OriginalPrice;
			writer[TableOrderItem.SalesGuidePrice] = SalesGuidePrice;
			writer[TableOrderItem.Discount] = Discount;
			writer[TableOrderItem.Quantity] = Quantity;
			writer[TableOrderItem.NumberOfUnitsID] = NumberOfUnitsID;
			writer[TableOrderItem.NumberOfUnitsName] = NumberOfUnitsName;
			writer[TableOrderItem.SubTotal] = SubTotal;
			writer[TableOrderItem.Creater] = Creater;
			writer[TableOrderItem.CreatedBy] = CreatedBy;
			writer[TableOrderItem.Created] = Created;
			writer[TableOrderItem.Modified] = Modified;
			writer[TableOrderItem.ModifiedBy] = ModifiedBy;
			writer[TableOrderItem.ModifiedByID] = ModifiedByID;
			writer[TableOrderItem.VegetablesID] = VegetablesID;
			writer[TableOrderItem.BusinessID] = BusinessID;
			writer[TableOrderItem.PurchasePrice] = PurchasePrice;
			writer[TableOrderItem.VegetablesNo] = VegetablesNo;
			writer[TableOrderItem.OrderItemNo] = OrderItemNo;
			writer[TableOrderItem.OrderItemStatusID] = OrderItemStatusID;
			writer[TableOrderItem.Weigth] = Weigth;
			writer[TableOrderItem.IsWeight] = IsWeight;
			writer[TableOrderItem.WeightCount] = WeightCount;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_OrderItemID = idd;
        }
		
		public string TableName
        {
            get { return TableOrderItem.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_OrderItemID = hashToRead["OrderItemID"];
			 
             m_OrdersID = hashToRead["OrdersID"];
			 
             m_VegetablesTypeID = hashToRead["VegetablesTypeID"];
			 
             m_VegetablesTypeName = hashToRead["VegetablesTypeName"];
			 
             m_VegetablesName = hashToRead["VegetablesName"];
			 
             m_OriginalPrice = hashToRead["OriginalPrice"];
			 
             m_SalesGuidePrice = hashToRead["SalesGuidePrice"];
			 
             m_Discount = hashToRead["Discount"];
			 
             m_Quantity = hashToRead["Quantity"];
			 
             m_NumberOfUnitsID = hashToRead["NumberOfUnitsID"];
			 
             m_NumberOfUnitsName = hashToRead["NumberOfUnitsName"];
			 
             m_SubTotal = hashToRead["SubTotal"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
             m_VegetablesID = hashToRead["VegetablesID"];
			 
             m_BusinessID = hashToRead["BusinessID"];
			 
             m_PurchasePrice = hashToRead["PurchasePrice"];
			 
             m_VegetablesNo = hashToRead["VegetablesNo"];
			 
             m_OrderItemNo = hashToRead["OrderItemNo"];
			 
             m_OrderItemStatusID = hashToRead["OrderItemStatusID"];
			 
             m_Weigth = hashToRead["Weigth"];
			 
             m_IsWeight = hashToRead["IsWeight"];
			 
             m_WeightCount = hashToRead["WeightCount"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["OrderItemID"] = OrderItemID;
			 
            hashToFill["OrdersID"] = OrdersID;
			 
            hashToFill["VegetablesTypeID"] = VegetablesTypeID;
			 
            hashToFill["VegetablesTypeName"] = VegetablesTypeName;
			 
            hashToFill["VegetablesName"] = VegetablesName;
			 
            hashToFill["OriginalPrice"] = OriginalPrice;
			 
            hashToFill["SalesGuidePrice"] = SalesGuidePrice;
			 
            hashToFill["Discount"] = Discount;
			 
            hashToFill["Quantity"] = Quantity;
			 
            hashToFill["NumberOfUnitsID"] = NumberOfUnitsID;
			 
            hashToFill["NumberOfUnitsName"] = NumberOfUnitsName;
			 
            hashToFill["SubTotal"] = SubTotal;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
            hashToFill["VegetablesID"] = VegetablesID;
			 
            hashToFill["BusinessID"] = BusinessID;
			 
            hashToFill["PurchasePrice"] = PurchasePrice;
			 
            hashToFill["VegetablesNo"] = VegetablesNo;
			 
            hashToFill["OrderItemNo"] = OrderItemNo;
			 
            hashToFill["OrderItemStatusID"] = OrderItemStatusID;
			 
            hashToFill["Weigth"] = Weigth;
			 
            hashToFill["IsWeight"] = IsWeight;
			 
            hashToFill["WeightCount"] = WeightCount;
			 
        }

        #endregion
		
	}
}
